
public class ComplexOperations {

	public static Complex addComplex(Complex c1, Complex c2){
		Complex r = new Complex(c1.getReal() + c2.getReal(), c1.getIm() + c2.getIm());
		return r;
	} 
	
	public static Complex subComplex(Complex c1, Complex c2){
		Complex r = new Complex(c1.getReal() - c2.getReal(), c1.getIm() - c2.getIm());
		return r;
	}
	
	public static Complex mulComplex(Complex c1, Complex c2){
		double norm = c1.getNorm() * c2.getNorm();
		double angle = c1.getAngle() + c2.getAngle();
		Complex r = new Complex(norm * Math.cos(angle), norm * Math.sin(angle));
		return r;
	}
	
	public static Complex mulComplex(double scalar, Complex c2){
		Complex r = new Complex(scalar * c2.getReal(), scalar * c2.getIm());
		return r;
	}
}
